<?php

namespace App\Http\Controllers\Api;

use App\Image;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class ImageController extends Controller
{
    public function ImageUpload(Request $request)
    {
        $path= $request->img->store('public/images');
        $map['url'] = Storage::url($path);
        $rew = Image::create($map);
        $rew['code'] = '200';
        return $rew;

    }
}
